package com.woniuxy.controllers;

import com.woniuxy.services.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class FileController {


    @Autowired
    private FileService fileService;
    @PostMapping("/upload")
    public String upload(@RequestParam("files") MultipartFile multipartFile){
        String url = fileService.upload(multipartFile);
        return  url;
    }
}